<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .element {
            height: 300px;
            width: 300px;
            background-color: teal;
            clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
            transition: clip-path 0.5s ease;
        }

        .element:hover {
            clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
        }
    </style>
</head>

<body>
    <div class="element"></div>
</body>

</html>